using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace X3DXNA.core.EventHandler
{
    public class EventHandler : Microsoft.Xna.Framework.GameComponent
    {
        List<IEvent> events;

        public EventHandler(Game game)
            : base(game)
        {
            events = new List<IEvent>();
        }

        public void registerEvent(IEvent e)
        {
            events.Add(e);
        }

        public override void Initialize()
        {

            base.Initialize();
        }

        public override void Update(GameTime gameTime)
        {
            foreach (IEvent e in events)
            {
                if (e.Notify)
                {
                    Console.WriteLine("Bella!!");
                }
            }
            base.Update(gameTime);
        }
    }
}
